package com.xbongbong.pay.platform.alipay.config;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.HashMap;
import java.util.Map;
import java.util.Objects;

/**
 * 支付宝 配置容器
 * @author 魏荣杰
 * @date 2021/1/20 17:26
 * @since
 * @version
 */
public class AliPayMetaContainer {
    private static final Logger LOG = LoggerFactory.getLogger(AliPayMetaContainer.class);


    public final Map<String, AliPayMeta> aliPayMetaMap = new HashMap<>();

    public AliPayMetaContainer addAliPayMeta(AliPayMeta aliPayMeta) {
        aliPayMetaMap.put(aliPayMeta.getMchId(), aliPayMeta);
        return this;
    }

    public AliPayMeta getAliPayMeta(String id) {
        return Objects.requireNonNull(aliPayMetaMap.get(id));
    }
}
